import Vue from 'vue'
import Router from 'vue-router'

const Home = () => import('views/home/Home')
const Category = () => import('views/category/Category')
const Carts = () => import('views/cart/Carts')
const Profile = () => import('views/profile/Profile')
const Detail = () => import('views/detail/Detail')
// 1.安装VueRouter
const Login = () =>import('common/login/Login.vue')
Vue.use(Router)

// 2.配置路由信息
const routes = [
  {
    path: '/',
    redirect: '/home',

  },
  {
    path: '/home',
    component: Home,
    meta:{
      showTab:true
    }
  
  },
  {
    path: '/category',
    component: Category,
    meta:{
      showTab:true
    }
  },
  {
    path: '/cart',
    component: Carts,
    meta:{
		showTab:true
	}
  },
  {
    path: '/profile',
    component: Profile,
    meta:{
      showTab:true
    }
  },
  {
    path:"/detail",
    component:Detail,
    meta:{
      showTab:false
    }
  },
  {
    path: "/login",
    component: () => {
      return import('common/login/Login.vue');
    },
    mate:{
      showTab:false
    }
  }
]
// 3.创建路由对象
const router = new Router({
  mode: 'history',
  routes
})

// 4.导出
export default router
